<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" charset="utf-8">
        /**
         * 注解描述
         * 优点：程序员有一个参考
         * 缺点：还是属于文档的范畴
         * 太松散，没有检查接口的方法是否完全被实现
         *
         *  interface Composite{
            function add(obj);
            function remove(obj);
            function update(obj);
        }
         */
        /**
         *
         * @constructor
         */
        var CompositeImpl = function () {
        };
        CompositeImpl.prototype.add = function () {
        }
        CompositeImpl.prototype.remove = function () {
        }
        CompositeImpl.prototype.update = function () {
        }
        var c1 = new CompositeImpl();
        var c2 = new CompositeImpl();
        alert(c1.add == c2.add);
    </script>
</head>
<body>
</body>
</html>